import { createStore } from 'redux'
import { addList, toggleState, setFilter, setListText } from './action/index'
import rootReducer from './reducer'

const store = createStore(rootReducer)
console.log(store.getState())

// 观察订阅状态
const unsubscribe = store.subscribe(()=>{
    console.log(store.getState())
})

store.dispatch(addList('this is a add content'))
store.dispatch(toggleState('0'))
store.dispatch(setFilter('active'))
store.dispatch(setListText('a'))

unsubscribe()